package com.easy.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class ImgStaticPathConfig implements WebMvcConfigurer {

    public static final String STATIC_PATH = "/img/";
    public static final String STATIC_DIR= "D:\\uploadfile\\";

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        //配置静态资源路径
        registry.addResourceHandler(STATIC_PATH+"**").addResourceLocations("file:"+STATIC_DIR);
    }
}
